package it.polito.ai.lhmf.orm;

// Generated 8-giu-2012 18.52.32 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Supplier generated by hbm2java
 */
@Entity
@Table(name = "supplier")
public class Supplier implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer idMember;
	private Member member;
	private String name;
	private String surname;
	private String username;
	private String password;
	private String regCode;
	private Date regDate;
	private String email;
	private String address;
	private String city;
	private String state;
	private int cap;
	private String tel;
	private boolean active;
	private byte memberType;
	private String companyName;
	private String description;
	private String contactName;
	private String fax;
	private String website;
	private String paymentMethod;
	private Set<Order> orders = new HashSet<Order>(0);
	private Set<Product> products = new HashSet<Product>(0);

	public Supplier() {
	}

	public Supplier(Member member, String name, String surname,
			String username, String password, String regCode, Date regDate,
			String email, String address, String city, String state, int cap,
			boolean active, byte memberType, String paymentMethod) {
		this.member = member;
		this.name = name;
		this.surname = surname;
		this.username = username;
		this.password = password;
		this.regCode = regCode;
		this.regDate = regDate;
		this.email = email;
		this.address = address;
		this.city = city;
		this.state = state;
		this.cap = cap;
		this.active = active;
		this.memberType = memberType;
		this.paymentMethod = paymentMethod;
	}

	public Supplier(Member member, String name, String surname,
			String username, String password, String regCode, Date regDate,
			String email, String address, String city, String state, int cap,
			String tel, boolean active, byte memberType, String companyName,
			String description, String contactName, String fax, String website,
			String paymentMethod, Set<Order> orders, Set<Product> products) {
		this.member = member;
		this.name = name;
		this.surname = surname;
		this.username = username;
		this.password = password;
		this.regCode = regCode;
		this.regDate = regDate;
		this.email = email;
		this.address = address;
		this.city = city;
		this.state = state;
		this.cap = cap;
		this.tel = tel;
		this.active = active;
		this.memberType = memberType;
		this.companyName = companyName;
		this.description = description;
		this.contactName = contactName;
		this.fax = fax;
		this.website = website;
		this.paymentMethod = paymentMethod;
		this.orders = orders;
		this.products = products;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idMember", unique = true, nullable = false)
	public Integer getIdMember() {
		return this.idMember;
	}

	public void setIdMember(Integer idMember) {
		this.idMember = idMember;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idMember_resp", nullable = false)
	public Member getMember() {
		return this.member;
	}

	public void setMember(Member member) {
		this.member = member;
	}

	@Column(name = "name", nullable = false, length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "surname", nullable = false, length = 45)
	public String getSurname() {
		return this.surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	@Column(name = "username", nullable = false, length = 45)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "password", nullable = false, length = 32)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "reg_code", nullable = false, length = 64)
	public String getRegCode() {
		return this.regCode;
	}

	public void setRegCode(String regCode) {
		this.regCode = regCode;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "reg_date", nullable = false, length = 10)
	public Date getRegDate() {
		return this.regDate;
	}

	public void setRegDate(Date regDate) {
		this.regDate = regDate;
	}

	@Column(name = "email", nullable = false, length = 45)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "address", nullable = false, length = 45)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "city", nullable = false, length = 45)
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "state", nullable = false, length = 45)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "cap", nullable = false)
	public int getCap() {
		return this.cap;
	}

	public void setCap(int cap) {
		this.cap = cap;
	}

	@Column(name = "tel", length = 45)
	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	@Column(name = "active", nullable = false)
	public boolean isActive() {
		return this.active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	@Column(name = "member_type", nullable = false)
	public byte getMemberType() {
		return this.memberType;
	}

	public void setMemberType(byte memberType) {
		this.memberType = memberType;
	}

	@Column(name = "company_name", length = 45)
	public String getCompanyName() {
		return this.companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	@Column(name = "description", length = 45)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "contact_name", length = 45)
	public String getContactName() {
		return this.contactName;
	}

	public void setContactName(String contactName) {
		this.contactName = contactName;
	}

	@Column(name = "fax", length = 45)
	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	@Column(name = "website", length = 45)
	public String getWebsite() {
		return this.website;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	@Column(name = "payment_method", nullable = false, length = 45)
	public String getPaymentMethod() {
		return this.paymentMethod;
	}

	public void setPaymentMethod(String paymentMethod) {
		this.paymentMethod = paymentMethod;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "supplier")
	public Set<Order> getOrders() {
		return this.orders;
	}

	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "supplier")
	public Set<Product> getProducts() {
		return this.products;
	}

	public void setProducts(Set<Product> products) {
		this.products = products;
	}

}
